package com.dk.academic;


import com.dk.academic.common.Common;
import org.junit.Test;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.ExitCodeGenerator;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

import javax.annotation.PreDestroy;
import java.net.InetAddress;
import java.net.UnknownHostException;


@SpringBootApplication
@MapperScan("com.dk.academic.mapper")
@EnableAutoConfiguration
public class AcademicApplication {
    public static void main(String[] args) {
        SpringApplication.run(AcademicApplication.class, args);
    }

    @Bean
    public ExitCodeGenerator exitCodeGenerator() {
        if (Common.client != null) {
            Common.client.close();
            System.out.println("连接正在关闭");
        }
        return () -> 42;
    }

}
